package com.example.springboot;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

//war包启动类
@SpringBootApplication
public class SpringbootdemoApplication /*extends SpringBootServletInitializer*/ {

	/*@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		return application.sources(SpringbootdemoApplication.class);
	}*/


	public static void main(String[] args) {
		SpringApplication.run(SpringbootdemoApplication.class, args);

	}
}




//针对自定义 Servlet、Filter 和 Listener 的配置另一种方式：
//@SpringBootApplication
//public class SpringbootWebApplication implements ServletContextInitializer {
//
//	@Override
//	public void onStartup(ServletContext servletContext) throws ServletException {
//		// 配置 Servlet
//		servletContext.addServlet("servletTest",new ServletTest())
//				.addMapping("/servletTest");
//		// 配置过滤器
//		servletContext.addFilter("timeFilter",new TestFilter())
//				.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST),true,"/*");
//		// 配置监听器
//		servletContext.addListener(new TestListener());
//	}
//
//	public static void main(String[] args) {
//		SpringApplication.run(SpringbootWebApplication.class, args);
//	}
//}
